#!/usr/bin/env node

const me = {},
      log = console.log,
      stdout = process.stdout,
      stdin = process.stdin,
      msg = ['name','email','qq','mobile']

let i = 0

//log(msg.length)
stdout.write(msg[i] + ':')
//log(msg[i] + ':')
stdin.on('data', (data) => {
  //log(data.toString('utf-8'))
  me[msg[i++]] = data.toString('utf-8')
  // log(msg[i] + ':')
  if(i<msg.length){
    stdout.write(msg[i] + ':')
  }
})
stdin.on('end', () => {
  log(me)
  log('bye')
})
